﻿using orderCreater.DBUtility;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace orderCreater
{
    public class MySqlHelp
    {
        private string connectString = null;
        public MySqlHelp(string connectString) {
            this.connectString = connectString;
        }

        public bool DoSQLExists(string connectString, string sqlstr)
        {
            return DB_Access.Exists(connectString, sqlstr);
        }
        public int ExecuteSql(string sqlstr)
        {
            return DB_Access.ExecuteSql(this.connectString, sqlstr);
        }
        public int ExecuteSql(string SQLString, params MySqlParameter[] cmdParms)
        {
            return DB_Access.ExecuteSql(this.connectString, SQLString, cmdParms);
        }
        public DataSet Query(string SQLString)
        {
            return DB_Access.Query(this.connectString, SQLString);
        }
        public DataSet ExecuteSqlDataSet(string sqlstr)
        {
            return DB_Access.Query(this.connectString, sqlstr);
        }
        public bool Exists(string strSql)
        {
            return DB_Access.Exists(this.connectString, strSql);
        }
        public object GetSingle(string SQLString, params MySqlParameter[] cmdParms)
        {
            return DB_Access.GetSingle(this.connectString, SQLString, cmdParms);
        }
    }
}
